<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"
    />
    <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
    <!-- <link rel="stylesheet" type="text/css" href="../src/assets/css/public.css"> -->
    <link
      rel="stylesheet"
      href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css"
    />
    <script
      type="text/javascript"
      src="https://webapi.amap.com/maps?v=1.4.15&key=0efecf5525a7e58661e2bdb8a1b40f41&plugin=AMap.CitySearch"
    ></script>
    <!-- <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css"/> -->

    <title>博图数字文旅全域旅游系统</title>
    <!-- <script type="text/javascript">
		var version = parseFloat(RegExp.$1);
		var phoneScale = parseInt(window.screen.width) / 360;
		if (/Android (\d+\.\d+)/.test(navigator.userAgent) && version > 2.3) {
			document.write('<meta name="viewport" content="width=750, maximum-scale=' + phoneScale + ', minimum-scale=' +
				phoneScale + ', user-scalable=no , target-densitydpi=device-dpi">');
		} else {
			document.write('<meta name="viewport" content="width=360, user-scalable=no , target-densitydpi=device-dpi">');
		}
	</script> -->
  </head>

  <body>
    <!-- <noscript>
      <strong>We're sorry but vuex doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript> -->
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
  <!-- <script src="../src/assets/js/vue_date_select.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="../dist/css/chunk-vendors.8938a8fe.css">
   <script src="../src/assets/js/vue.js" type="text/javascript"></script> -->
  <!-- <script type="text/javascript" src="http://webapi.amap.com/mapsv=1.4.4&key=f18c8e64e936fd4b1ff874583de50367"></script> -->
</html>

<!--下面开始时通用的分享JS的,只需要加这段代码即可-->

<script
  language="javascript"
  src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"
></script>
<script language="javascript" src="jquery-3.5.1.min.js"></script>
<script language="javascript" src="jquery.cookie.js"></script>
<script>
  var bt_appid = 'BT_wenlv_N9EAn3Z' //请用博图提供的APPID

  //分享朋友圈文案配置
  var wxData_Timeline = {
    desc: '用博图数字文旅方便又划算', //分享的描述
    imgUrl: 'https://wenlv.botuu.com/public/statics/img/share.jpg', //配图,建议是400*400 正方形的
    link: $.cookie('shareurl'), //点击的跳转地址
  }

  //发好友文案配置
  var wxData_AppMessage = {
    title: '博图数字文旅全域旅游系统', //标题
    desc: '用博图数字文旅方便又划算', //描述
    imgUrl: 'https://wenlv.botuu.com/public/statics/img/share.jpg', //配图,建议是400*400 正方形的
    link: $.cookie('shareurl'), //点击的跳转地址
  }

  var weixinWX = wx
  //初始化微信配置的函数
  //参数r是一个对象,含有配置需要的信息的了
  function botuuInitWXShare(data) {
    eval('var r=' + data)
    weixinWX.config({
      debug: false,
      appId: r.appId,
      timestamp: r.timestamp,
      nonceStr: r.nonceStr,
      signature: r.signature,
      // 必填，需要使用的JS接口列表，所有JS接口列表见附录2，如有其他权限需求，请自行添加
      jsApiList: ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage'],
    })
    //绑定的
    weixinWX.ready(function() {
      weixinWX.checkJsApi({
        jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage'],
        success: function(res) {
          //alert("success：" +JSON.stringify( res));
        },
      })
      weixinWX.showOptionMenu()
      reflushShareInfo()
      weixinWX.error(function(res) {
        //alert("e："+JSON.stringify( res));
      })
    })
  }

  //如果需要动态更改分享文案,那么请修改 wxData 对象对应的参数,然后再调一下这个函数的.发送给朋友和分享到好友圈就会自动改变文案的了
  function reflushShareInfo() {
    weixinWX.onMenuShareAppMessage({
      title: wxData_Timeline.desc, // 分享标题
      link: $.cookie('shareurl'), // 分享链接
      imgUrl: wxData_Timeline.imgUrl, // 分享图标
      success: function() {
        //分享成功后的处理
      },
      cancel: function() {
        //分享取消后的处理
      },
    })

    weixinWX.onMenuShareTimeline({
      title: wxData_Timeline.desc, // 分享标题
      link: $.cookie('shareurl'), // 分享链接
      imgUrl: wxData_Timeline.imgUrl, // 分享图标
      success: function() {
        //分享成功后的处理
      },
      cancel: function() {
        //分享取消后的处理
      },
    })
  }

  function gettoken() {
    var token = $.cookie('token') || ''
    return token
  }

  function Setparam() {
    var sharecode = getQueryVariable('sharecode')
    if (sharecode != '') {
      $.cookie('sharecode', sharecode, { path: '' })
    }
    if (($.cookie('shareurl') || '') == '') {
      $.cookie('shareurl', 'https://www.anyiyou.cn/view/#/', { path: '/' })
    }

    var token = getQueryVariable('token')

    if (token != '') {
      $.cookie('token', token, { expires: 7, path: '/' })
    }
  }

  function getQueryVariable(variable) {
    var query = window.location.href
    var vars = query.split('?')
    for (var i = 0; i < vars.length; i++) {
      var pair = vars[i].split('=')
      if (pair[0] == variable) {
        // console.log(pair[1]);
        return pair[1]
      }
    }
    return ''
  }

  function getParamName(name) {
    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
    var r = window.location.search.substr(1).match(reg)
    if (r != null) {
      return unescape(r[2])
    } else {
      return null
    }
  }

  //远程获取分享需要的一些参数的
  function getShareDataFromBotuu() {
    var geturl =
      'https://u.botuu.com/api/weixin/JSDK/getTicket.aspx?appid=' +
      escape(bt_appid) +
      '&url=' +
      escape(document.URL) +
      '&r=' +
      new Date() +
      '&jsoncallback=botuuInitWXShare'
    var wxxx = document.createElement('script')
    wxxx.src = geturl
    var s = document.getElementsByTagName('script')[0]
    s.parentNode.insertBefore(wxxx, s)
  }
  Setparam()
  getShareDataFromBotuu()

  if (isWeiXin() && gettoken() == '') {
    window.location.href =
      'https://www.anyiyou.cn/public/program/loginApi.aspx?api=weixin&bkurl= ' +
      encodeURI('https://www.anyiyou.cn/view')
  }

  function isWeiXin() {
    var ua = window.navigator.userAgent.toLowerCase()
    console.log(ua) //mozilla/5.0 (iphone; cpu iphone os 9_1 like mac os x) applewebkit/601.1.46 (khtml, like gecko)version/9.0 mobile/13b143 safari/601.1
    if (ua.match(/MicroMessenger/i) == 'micromessenger') {
      return true
    } else {
      return false
    }
  }
</script>
